package org.tloss.web.spring;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;

@XmlAccessorType(XmlAccessType.PROPERTY)
public class View {

	String returnCase;
	String viewName;

	@XmlAttribute(name = "return-case")
	public String getReturnCase() {
		return returnCase;
	}

	public void setReturnCase(String returnCase) {
		this.returnCase = returnCase;
	}

	@XmlAttribute(name = "view-name")
	public String getViewName() {
		return viewName;
	}

	public void setViewName(String viewName) {
		this.viewName = viewName;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((returnCase == null) ? 0 : returnCase.hashCode());
		result = prime * result
				+ ((viewName == null) ? 0 : viewName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		View other = (View) obj;
		if (returnCase == null) {
			if (other.returnCase != null)
				return false;
		} else if (!returnCase.equals(other.returnCase))
			return false;
		if (viewName == null) {
			if (other.viewName != null)
				return false;
		} else if (!viewName.equals(other.viewName))
			return false;
		return true;
	}

}
